<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Thanh Luan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<f:subview id="conf425475">
    <html>
        <head>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
            <!-- --><script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
            <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
            <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
            <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
            <link rel="stylesheet" type="text/css" href="../css/cssdivtable.css"/>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>
            <link rel="stylesheet" type="text/css" href="../css/rateit.css">
            <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
            <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>
            <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
            <script type="text/javascript">
                $j(document).ready(function(){
                    initThickBox('.thickbox');
                });
            </script>
            <script type="text/javascript" language="javascript">
                var open_cur = 0;
                $j = jQuery.noConflict();
            
                $j(document).ready(function(){
                    $j('input#leavedate111').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate112').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate1a').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('input#leavedate1b').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                    $j('.text_search').live('keyup',function(){
                        if($j('.text_search').val() == ""){
                        
                            $j('.headerdivtable_bootom').show();
                            $j('.close').trigger('click');   
                        }else{
                            $j('.close').trigger('click');
                            $j('.headerdivtable_bootom').hide();
                            $j('.headerdivtable_bootom').each(function(){
                                html = $j(this).html();
                                if(   ununicode(html).indexOf(  ununicode($j('.text_search').val()) ) > -1    )  {
                                    $j(this).show();
                                }else{
                                    $j(this).hide();
                                }
                            });
                        }

                    });
                    //
                    $j('.st_horizontal').slideTabs();
                    Tab4Kapi();
                    $j(".rateit").bind('rated', function (event, value) { 
                        pn100 = $j(this).attr('lang');
                        
                        star_value = value;
                       
                        $j.post("star.jsp?action=favourite&flag=starcustomer&ni105="+star_value+'&pn100='+pn100,function(){

                        });
                    });

                    $j('.header-box').live('click', function(){    
                        $j(".mesage").text("");
                        if($j(this).next('.customer-box').css('display') != 'none'){
                            return;
                        }else{
                            //var PN100=$j('#form-input-customerform\\:PN100').val();
                            var PN100 = $j('#formKHCN\\:pn100').val(); 
                            if(PN100 != 0)
                            {
                                $j('.messa').hide();
                                $j('.customer-box').slideUp();                         
                                $j('.boder-bomttom').removeClass('boder-bomttom');
                                $j(this).next('.customer-box').slideDown();
                                $j(this).addClass('boder-bomttom');
                            } else{                        
                                $j('.messa').show();
                                $j(this).next('.customer-box').css('display') != 'none'
                            }
                           
                        }

                    });
                    //                    $j(".showdatafor").live("click",function(){
                    //               
                    //                        $j(this).next().css('display','block'); 
                    //                    });
                    $j(".clickShow").live("click",function(){
                        $j(this).parent().parent().css('display','none');
                    });
                    $j('.acountT025C').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#form-input-customer\\:pn100').val();      
                        $j.post("accountCRM.jsp?action=editajaxpage&pn100="+pn100KH+"&tv026=N100",function(data){
                            $j('.customer-boxacount').html(data);
                        }) ;
                    
                    });
                
                    $j('.customerK100').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#form-input-customer\\:pn100').val();    
                        $j.post("customerdemo.jsp?action=editEmp&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
                            $j('.customer-boxcustomer').html(data);
                        });
                    
                    });
                
                    $j('.infoN350').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#form-input-customer\\:pn100').val();     
                        $j.post("passportCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                            $j('.customer-boxN350').html(data);
                        });
                    
                    });
                    $j('.companyCRM').live('click',function(){
                        object = $j(this).next();
                        var pn100KH = $j('#form-input-customer\\:pn100').val();     
                        $j.post("companyCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                            $j('.customer-companyCRM').html(data);
                        }) ;
                    
                    }); 
                    // Load ajax form 
                    $j('.contactN950C').live('click',function(){
                        object = $j(this).next();
                        
                        var PN100i  =$j("#form-input-customer\\:pn100").val();
                        
                        $j.post("contactCRM.jsp?action=editajaxpage&pn100="+ PN100i+"&table=K100", function(data){
                            $j('.customer-boxcontact').html(data);
                        });
                        
                    });
                    
                    $j('.acountT025C').live('click',function(){
                        object = $j(this).next();
                        var PN100i  =$j("#form-input-customer\\:pn100").val();   
                        $j.post("accountCRM.jsp?action=editajaxpage&pn100="+PN100i+"&tv026=K100&itemid=K100",function(data){                    
                            $j('.customer-boxacount').html(data);
                        }) ;
                                        
                    });
                    //                                        $j('.otherinfoC').live('click',function(){
                    //                                            object = $j(this).next();
                    //                                            var pn100KH = $j('#form-input-customer\\:pn100').val(); 
                    //                                            $j.post("customerdemo.jsp?action=editajaxpage&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
                    //                                                $j('..customer-boxacount').html(data);
                    //                                            });
                    //                                        
                    //                                        });
                    
                    $j('.otherinfoC').live('click',function(){
                        object = $j(this).next();
                        var PN100i  =$j("#form-input-customer\\:pn100").val();   
                        $j.post("companyOther.jsp?action=editajaxpage&pn100="+PN100i+"&tv026=K100&itemid=K100",function(data){                    
                            $j('.customer-boxother').html(data);
                        }) ;
                    
                    });
                    
                    $j('.buttonsave2').live('click',function(){
                        $j('.fromsearch').css('display', 'block');
                        $j('#searchEm').css('display', 'block');
                        $j('.addEm').css('display', 'none');
                        $j('.addPersonDD').css('display', 'none');
                        $j(this).css('display', 'none');
                        $j('.buttonsave1').css('display', 'block');
                        $j('.buttonsave3').css('display', 'block');
                        $j.post("pageemployeeInput.jsp?action=reloadEmp",function(data){
                            if(data!=null){
                                $j(".aaaa").html(data);
                            }else{
                                $j(".aaaa").html(data);
                            }
                            //reload lai danh sach khach hang ca nhan sau khi them nhan vien tren popup
                              
                        });
                    });
                    
                    
                    $j('.empCOMP').live('click',function(){
                      
                        object = $j(this).next();
                        var PN100i  =$j("#form-input-customer\\:pn100").val();   
                        $j.post("employeeInputCompany.jsp?action=reloadEmp1&pnPK100="+PN100i,function(data){                    
                            $j('.formPesonal').html(data);
                            $j('.buttonsave2').trigger('click');
                        }) ;
                        
                       
                    });
                    
                    $j('.loadHistory').live('click',function(){
                        dayss = $j(this).attr('lang');
                        $j.post("actionCutomer.jsp?action=reloadfordays&dayss="+dayss,function(data){
                            if(data!=null){
                                window.location.href="cuscompany.jsp?action=reloadfordays&dayss="+dayss;
                            }
                        });
                    });
                    
                    $j('.goTour').live('click',function(){
                        $j(this).parents('.group_manager').parents('.item').find('.edit_more').find('.select_hidden').find('.menu-context-tour').trigger('click');
                    });
                });
            </script>


        </head>
        <body>
            <div id="togglesms">
            </div>
            <a4j:form>
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
                <h:outputText value="<div class='permission' lang='#{loginSession.right.MENU_COM_VIEW}'></div>" escape="false"/>
                <div id="content">
                    <div id="menu_top" class="menutop2">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#"><span>Khu vực</span></a>
                            </div>
                            <div class="select_hidden">
                                <ul>
                                    <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                    <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                </ul>
                            </div>
                        </div>
                        <h:panelGroup rendered="#{loginSession.right.CUS_LST_PAR}">
                            <div class="dropdown">
                                <div class="select_choise">
                                    <a href="#">
                                        <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                            <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                            <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                        </span>
                                    </a>

                                </div>
                                <div class="select_hidden departmentlistN850">
                                    <ul>
                                        <li><a href="#">
                                                <span class="department3" lang="<h:outputText value="0"/>">
                                                    <h:outputText value="Tất cả"/>
                                                </span>
                                            </a>
                                        </li>                                  
                                        <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                            <li><a href="#">
                                                    <span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                        <h:outputText value="#{item.label}"/>
                                                    </span>
                                                </a>
                                            </li> 
                                        </a4j:repeat>
                                    </ul>
                                </div>
                            </div>
                        </h:panelGroup>
                        <div style="float:left;margin-right: 2px;margin-left: 2px;">
                            <h:outputLink  rendered="#{loginSession.right.COM_LST_CRE}" value="editfromcompany.jsp?action=add&height=236px&width=405px" styleClass="fancybox add_new" id="fancybox">
                                <h:graphicImage title="Thêm công ty" value="../images/icon_addTour.png"/>
                            </h:outputLink>



                        </div>
                        <div style="float:left;margin-left: 2px;margin-right: 2px;">
                            <div class="sidebar_row2">
                                <h:panelGroup rendered="#{loginSession.right.COM_LST_SER}">

                                    <div class="sidebar">
                                        <div class="sidebar_search">

                                        </div>
                                        <div class="search_boxnew" style="display:none;">
                                            <rich:tabPanel switchType="client">
                                                <rich:tab label="Group">
                                                    <a4j:region>
                                                        <h:selectOneMenu value="#{k100Controller.fk400}" id="groupfk400" styleClass="select_cus"   >

                                                            <f:selectItems value="#{k100Controller.groupOther}" />
                                                            <a4j:support event="onchange"  actionListener="#{k100Controller.changeGroupOther}" reRender="btnSubmit22,reloadn100, reload2, reload5" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();"/>
                                                        </h:selectOneMenu>
                                                    </a4j:region>
                                                </rich:tab>
                                                <rich:tab label="Status">
                                                    <div class="fields_input">
                                                        <h:outputText value="Status:" style="float:left;line-height:20px;"/>

                                                        <a4j:region>
                                                            <h:outputText value="Status:" style="float:left;line-height:20px;"/>
                                                            <h:selectOneMenu value="#{k100Controller.FK330}" style="float:left;line-height:20px;" styleClass="cbx_editEmp">
                                                                <f:selectItems value="#{k100Controller.listComboK330}"/>
                                                                <a4j:support event="onchange" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();" reRender="btnSubmit22,reloadn100, reload2, reload5"  actionListener="#{k100Controller.reloadStatus}"> 

                                                                </a4j:support>
                                                            </h:selectOneMenu>

                                                        </a4j:region>
                                                        <a4j:region>
                                                            <h:outputText value="Nguồn:" style="float:left;line-height:20px;"/>

                                                            <h:selectOneMenu   style="width:114px;float:left;" styleClass="cbx_editEmp" value="#{k100Controller.FK300}">
                                                                <f:selectItems value="#{k100Controller.listComboK300}"/>
                                                                <a4j:support event="onchange" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();" reRender="btnSubmit22,reloadn100, reload2, reload5"  actionListener="#{k100Controller.reloadStatus1}"> 

                                                                </a4j:support>
                                                            </h:selectOneMenu>


                                                        </a4j:region>
                                                    </div>

                                                    <div class="fields_select imagesearchbox" style="float:left;" >
                                                        <h:outputText style="float:left;" value="Tìm theo thời gian:"/>
                                                        <div style="float: left;">
                                                            <input style="width: 82px;float: left;" value="<h:outputText value="#{k100Controller.startDateSta}"><f:convertDateTime pattern="dd/MM/yyyy"/> 
                                                                   </h:outputText>" type="text" id="leavedate111" name="leavedate111" class="" />
                                                        </div>
                                                        <div style="float: left;">
                                                            <input style="width: 82px;float: left;margin-left: 20px;" value="<h:outputText value="#{k100Controller.endDateSta}"><f:convertDateTime pattern="dd/MM/yyyy"/> 
                                                                   </h:outputText>" type="text" id="leavedate112" name="leavedate112" class="" />
                                                        </div>
                                                        <div style="float: left;">
                                                            <h:panelGroup id="submitStatus">
                                                                <h:commandButton style="float:left;margin-left:25px;margin-bottom:10px;"  actionListener="#{k100Controller.reloadStatus}" value="Tìm" styleClass="buttonsave">

                                                                </h:commandButton>

                                                            </h:panelGroup >
                                                        </div>
                                                    </div>
                                                </rich:tab>
                                                <rich:tab label="Create group">
                                                    <div class="fields_input" style="border-bottom:none;width: 50%;">
                                                        <h:inputText styleClass="groupname" value="#{k400Controller.KV401}" style="width:188px;" onblur="if(this.value=='')this.value='#{k400Controller.KV401}';" onfocus="if(this.value=='#{k400Controller.KV401}')this.value='';"  />
                                                    </div>
                                                    <div class="fields_submit">
                                                        <h:panelGroup id="btnSubmit22">
                                                            <h:commandButton   onclick="if( $j('.groupname').val()=='' || $j('.groupname').val()=='Nhập tên nhóm') return false; else return true;"  action="#{k400Controller.saveK400forK100}" value="Thêm nhóm" styleClass="buttonsave">

                                                            </h:commandButton>
                                                            <h:outputLink style="color:#fff;"   value="sendMoreSMS.jsp?page=cuscompany&pk400=#{k100Controller.fk400}&type=#{k100Controller.KN114}&dayss=#{k100Controller.dayss}&height=453&amp;width=741&amp;modal=true" styleClass="fancybox buttonsaveS" id="thickbox333"  ><h:outputText value="Gửi SMS"/></h:outputLink>
                                                        </h:panelGroup >                                        
                                                    </div>
                                                </rich:tab>
                                                <rich:tab label="Thống kê 1 ngày">
    
                                                    <div style="width:100%;float: left;margin-top: 5px;margin-bottom: 5px;">
                                                        <a4j:outputPanel layout="block">
                                                            <rich:calendar  value="#{k100Controller.startDateSta}" id="calendar" locale="US" popup="true" datePattern="dd/MM/yyyy" showApplyButton="false" cellWidth="24px" cellHeight="21px">
                                                            </rich:calendar>
                                                        </a4j:outputPanel>
                                                    </div>
                                                     <div style="width:100%;float: left;">
                                                          <a4j:outputPanel layout="block">
                                                              <rich:calendar  value="#{k100Controller.endDateSta}" id="calendar12" locale="US" popup="true" datePattern="dd/MM/yyyy" showApplyButton="false" cellWidth="24px" cellHeight="21px">
                                                              </rich:calendar>
                                                          </a4j:outputPanel>
                                                      </div>
                                                    <div style="width:100%;float: left;margin-top: 5px;margin-bottom: 5px;">
                                                        Hiện tại chưa có chức năng này
                                                        <a4j:commandButton style="width:35px;" onclick="showPleaseWait();" oncomplete="hidePleaseWait();"  actionListener="#{k100Controller.reloadDAYS}" value="Tìm" >

                                                        </a4j:commandButton></div>
                                                    </rich:tab>
                                                </rich:tabPanel>

                                        </div>
                                    </div>
                                </h:panelGroup>
                            </div>
                        </div>
                        <div style="float:left;margin-left: 2px;margin-right: 2px;">
                            <div class="classimageSMS" lang="<h:outputText value="#{CustomerBean.fk100down}"/>">
                                <img src="../images/smsnew.png" class="sendSMS_person" lang="page=cuscompany.jsp&group=0" title="Xác nhận  SMS"/>
                            </div>
                        </div>
                        <div style="float:left;margin-left: 2px;margin-right: 2px;">
                            <h:outputLink   value="popUpSendEmail.jsp?page=employee&step=9&fk100reload=0&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new abc" id="thickbox15"  >
                                <h:graphicImage value="../images/emailnew.png"/>
                            </h:outputLink>
                        </div>
                        <div style="float:left;margin-left: 2px;margin-right: 2px;">
                            <h:commandButton  style="margin-left:0px;" actionListener="#{EmpBean.exportExcel()}"  
                                              onclick="showPleaseWait();"                                   
                                              styleClass="buttonExcel" >                
                            </h:commandButton>
                        </div>
<%--
                        <div class="fillterby" style="float:left;margin-left: 2px;margin-right: 2px;">
                            <h:panelGroup id="daysss" rendered="#{loginSession.right.COM_LST_PER}">
                                <div class="dropdownby">
                                    <div class="select_choise showdatafor">

                                        <h:panelGroup  rendered="#{k100Controller.dayss==0}"><img src="../images/icon_list.png" alt="Thêm vào tour" title="Danh sách khách hàng" /></h:panelGroup>
                                        <h:panelGroup rendered="#{k100Controller.dayss==7}"><img src="../images/icon_list.png" alt="Thêm vào tour" title="Danh sách 1 tuần" /></h:panelGroup>
                                        <h:panelGroup rendered="#{k100Controller.dayss==14}"><img src="../images/icon_list.png" alt="Thêm vào tour" title="Danh sách 2 tuần" /></h:panelGroup>
                                        <h:panelGroup rendered="#{k100Controller.dayss==21}"><img src="../images/icon_list.png" alt="Thêm vào tour" title="Danh sách 3 tuần" /></h:panelGroup>
                                        <h:panelGroup rendered="#{k100Controller.dayss==28}"><img src="../images/icon_list.png" alt="Thêm vào tour" title="Danh sách 4 tuần" /></h:panelGroup> 

                                    </div>

                                    <div class="select_hidden">
                                        <ul>
                                            <li class="loadHistory" lang="0"><a href="#"><span><h:outputText value="Danh sách KH"/></span></a></li>
                                            <li class="loadHistory" lang="7"><a href="#"><span><h:outputText value="Danh sách 1 tuần"/></span></a></li>
                                            <li class="loadHistory" lang="14"><a href="#"><span><h:outputText value="Danh sách 2 tuần"/></span></a></li>
                                            <li class="loadHistory" lang="21"><a href="#"><span><h:outputText value="Danh sách 3 tuần"/></span></a></li>
                                            <li class="loadHistory" lang="28"><a href="#"><span><h:outputText value="Danh sách 4 tuần"/></span></a></li>
                                        </ul>
                                    </div>
                                </div>
                            </h:panelGroup>
                        </div>

--%>
                        <div class="fillter">
                            <div class="dropdown">
                                <h:panelGroup id="reload2">
                                    <h:panelGroup  rendered="#{CustomerBean.groupID == 0}" >
                                        <div class="select_choise s3">
                                            <a href=""><span><h:outputText value="#{locale.normal_customer}"/></span></a>
                                        </div>


                                        <div class="select_hidden">
                                            <ul>
                                                <h:panelGroup rendered="#{loginSession.right.COM_LST_HID}">
                                                    <li class="s31"  <h:outputText rendered="#{k100Controller.KN114 == 0}" value="style='display:none'" /> >
                                                        <a href="cuscompany.jsp?type=0"><span><h:outputText value="#{locale.hiddencustomer}"/></span></a>
                                                    </li>   
                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{loginSession.right.COM_LST_NOR}">
                                                    <li class="s32" <h:outputText rendered="#{k100Controller.KN114 == 1}" value="style='display:none'" /> >
                                                        <a href="cuscompany.jsp?type=1"><span><h:outputText value="#{locale.normal_customer}"/></span></a>
                                                    </li>
                                                </h:panelGroup>
                                            </ul>
                                        </div>
                                    </h:panelGroup>
                                </h:panelGroup>
                                <h:panelGroup id="reloadn100A">
                                    <h:panelGroup  rendered="#{CustomerBean.groupID > 0}" >
                                        <div class="select_choise ">

                                            <a href="#"><span><h:outputText value="Action"/></span></a>
                                        </div>
                                        <div class="select_hidden">
                                            <ul>
                                                <li>
                                                    <h:outputLink rendered="#{CustomerBean.groupID > 0}" value="addgroupcustomer.jsp?action=loadGroup&page=customer.jsp&pk400=#{CustomerBean.groupID}&kv451=N100C&KeepThis=true&amp;TB_iframe=true&amp;height=453&amp;width=941&amp;modal=true" styleClass="thickbox add_new" id="thickbox2"  >
                                                        <span> <h:outputText value="#{locale.add_group}"/></span>
                                                    </h:outputLink>
                                                </li>
                                                <li >
                                                    <h:outputLink rendered="#{CustomerBean.groupID > 0}" value="removegroupcustomer.jsp?action=loadGroup&page=customer.jsp&pk400=#{CustomerBean.groupID}&kv451=N100C&KeepThis=true&amp;TB_iframe=true&amp;height=425&amp;width=952&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  >
                                                        <span> <h:outputText value="#{locale.delete_group}"/></span>
                                                    </h:outputLink>
                                                </li>
                                            </ul>
                                        </div>
                                    </h:panelGroup>
                                </h:panelGroup>

                            </div>

                        </div>
                        <h:panelGroup rendered="#{loginSession.right.COM_LST_PAR}">
                            <div class="cbxEmp"> 
                                <h:inputHidden value="#{k100Controller.loginEmp}"/>

                                <h:selectOneMenu  value="#{k100Controller.loginEmp}" styleClass="cbx_editEmp" id="ckb_098">
                                    <f:selectItems value="#{k100Controller.lstEmpByID}" />
                                    <a4j:support event="onchange"  reRender="reloadn100"  actionListener="#{k100Controller.reloadlist}"> 

                                    </a4j:support>
                                </h:selectOneMenu>

                            </div>
                        </h:panelGroup>
                        <div class="groupcontanersearch">
                            <h:inputText style="  float: left;height: 25px; margin-left: 0;width: 86%;" value="#{k100Controller.keySearch}" onfocus="if(this.value=='#{k100Controller.keySearch}')this.value='';" styleClass="text_search"  />
                            <div  style="float:left;" class="buttonsearch">
                                <div class="group cssgroup" >
                                    <h:selectOneRadio layout="pageDirection" value="#{k100Controller.typeSearch}" styleClass="feild_sex"  style="margin-left:5px; margin-top:4px; padding:15px; width:195px; height:118px;"   >
                                        <f:selectItem itemValue="0" itemLabel="#{locale.all}" />
                                        <f:selectItem itemValue="1" itemLabel="Tên công ty"/>
                                        <f:selectItem itemValue="2" itemLabel="#{locale.telephone}"/>
                                        <f:selectItem itemValue="5" itemLabel="Mã số thuế"/>
                                        <f:selectItem itemValue="6" itemLabel="MSKH"/>
                                    </h:selectOneRadio>
                                    <h:commandButton      actionListener="#{k100Controller.reload}" value="#{locale.search}" style="margin-left:75px; margin-top:5px;" styleClass="buttonsearch2">
                                    </h:commandButton>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div id="content_detail">

                        <div class="content_right">
                            <div class="content" id="">
                                <div class="list_content" style="margin-top: 0px;" >
                                    <div style="width: 100% !important;float:left;">
                                        <div class="headerdivtable">
                                            <div class="itemheaderdivtable_center" style="width: 2%;">
                                                <h:outputText value="NUM"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 10%;">
                                                <h:outputText value="ACTION"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 2%;">
                                                <h:selectBooleanCheckbox style="margin-left:0px" styleClass="checkAll" value=""/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 14%;">
                                                <h:outputText value="FULLNAME"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 10%;">
                                                <h:outputText value="TRADING NAME"/>
                                            </div>
                                            <%--  <div class="itemheaderdivtable_center" style="width: 3%;">
                                                  <h:outputText value="CATEGORIES" />
                                              </div> --%>
                                            <div class="itemheaderdivtable_center" style="width: 6%;">
                                                <h:outputText value="TEL"/>
                                            </div>

                                            <div class="itemheaderdivtable_center" style="width: 12%;">
                                                <h:outputText value="EMAIL"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width:8%;">
                                                <h:outputText  value="RATING"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width:2%;">
                                                <h:outputText  value="TOUR"/>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width:10%;">
                                                <h:outputText  value="PERSON RESPON"/>
                                            </div>
                                            <div  class="itemheaderdivtable_center" style="width: 12%;">
                                                <h:outputText value="NOTE" />
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 12%;">
                                                <h:outputText value="UPDATE"/>
                                            </div>
                                        </div>
                                        <h:panelGroup id="reloadcustomer">
                                            <div class="headerdivtable_over">
                                                <a4j:repeat  value="#{k100Controller.listK100}" var="item" rowKeyVar="index">    
                                                    <div class="headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                                        <div class="itemheaderdivtable_center " style="width: 2%;color:#0055A6;">
                                                            <h:outputText value="#{index+k100Controller.offset+1}" >
                                                                <f:convertNumber  pattern="##000"></f:convertNumber>
                                                            </h:outputText>
                                                        </div>
                                                        <div class="itemheaderdivtable_center " style="width: 10%;margin-top: 4px;">
                                                            <h:outputLink  style="float:left;margin-right: 1px;" value="workChargeDashInput.jsp?action=addDash&pn100=#{item.pk100}&fk100=#{item.pk100}&page=cuscompany.jsp&height=300px&width=500px" styleClass="fancybox">
                                                                <img src="../images/workcharge.png" alt="CH" title="Cham sóc khách hàng"/>
                                                            </h:outputLink>
                                                            <h:outputLink  style="float:left;margin-right: 1px;" rendered="#{loginSession.right.COM_LST_MOD}"  value="editfromcompany.jsp?action=edit&pnPK100=#{item.pk100}&height=236px&width=405px" styleClass="fancybox">
                                                                <img src="../images/edit.png" alt="edit" title="edit"/>
                                                            </h:outputLink>
                                                            <h:outputLink style="float:left;margin-right: 1px;"  rendered="#{loginSession.right.COM_LST_DEL}"  value="delete.jsp?id=#{item.pk100}&flag=K100&width=300&height=150" styleClass="fancybox">
                                                                <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                            </h:outputLink>
                                                            <h:outputLink style="float:left;margin-right: 1px;" value="noteCOM.jsp?action=addnote&pnPK100=#{item.pk100}&addTip=0&height=300px&width=400px" styleClass="fancybox">
                                                                <img src="../images/add_tab.png" alt="C?p nh?t ghi chú"/>
                                                            </h:outputLink>
                                                            <h:panelGroup >
                                                                <div class="select_group " style="margin-right: 1px;margin-left: 0px;">
                                                                    <h:outputLink value="listTour.jsp?action=addPTour&flagaddTour=noList&pn100=#{item.pk100}">
                                                                        <div class="choise_groups_tour" lang="<h:outputText value="#{item.pk100}"/>">

                                                                        </div> </h:outputLink>
                                                                    </div>
                                                            </h:panelGroup>
                                                            <h:panelGroup rendered="#{loginSession.right.COM_LST_UPB}">
                                                                <div class="select_group " style="margin-right: 1px;margin-left: 0px;">
                                                                    <div class="choise_groups" lang="<h:outputText value="#{item.pk100}"/>"></div>
                                                                    <div class="choise_groups_hiden">
                                                                        <div class="group_header"><h:outputText value="Nhóm"/></div>
                                                                        <div class="group_list_cus" lang="<h:outputText value="#{item.pk100}"/>">
                                                                            <a4j:repeat value="#{k100Controller.listQK400Filter}" var="q400">
                                                                                <h:outputText style="color:white" value="#{q400.label}" styleClass="updateq400" lang="#{q400.val}"/>  
                                                                            </a4j:repeat>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </h:panelGroup>
                                                        </div>
                                                        <div class="itemheaderdivtable_center " style="width: 2%;margin-top: 4px;">
                                                            <h:selectBooleanCheckbox style="margin-left:0px" styleClass="checkAll" value=""/>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 14%;">
                                                            <h:outputText styleClass="itemcontent itemcontent#{item.pk100}"  style="color:#0055A6;font-weight:bold;" title="#{item.kv103}" value="#{item.subKv103} " lang="#{item.pk100}"/>
                                                            <%-- <h:outputText styleClass="itemcontent itemcontent#{item.pk100}"  value="#{item.kv103} " lang="#{item.pk100}"/>--%>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 10%;">
                                                            <div style="width: 100%">
                                                                <h:outputText rendered="#{item.kv105!=null}" value="#{item.subKv105}" title="#{item.kv105}"/>
                                                                <h:outputText rendered="#{item.kv105==null}" value="Null"/>
                                                                <h:outputText rendered="#{item.kv105==''}" value="Null"/>
                                                            </div>
                                                        </div>
                                                        <%-- <div class="itemheaderdivtable_center " style="width: 3%;">
                                                             <h:outputText value="#{item.nv552}" />
                                                         </div> --%>
                                                        <div class="itemheaderdivtable_left " style="width: 6%;">

                                                            <h:outputLink style="padding-left: 5px;font-style: italic;" value="sendSMS.jsp?action=sendSMS&page=cuscompany.jsp&pk400=#{k100Controller.fk400}&type=#{k100Controller.KN114}&dayss=#{k100Controller.dayss}&hoten=#{item.kv103}&pn100=#{item.pk100}&phone=#{item.kv961}" styleClass="fancybox">
                                                                <h:outputText value="#{item.kv958}"/> 
                                                            </h:outputLink>
                                                        </div>
                                                        <div  class="itemheaderdivtable_left " style="width: 12%;">
                                                            <h:outputLink style="padding-left: 5px;font-style: italic;" value="popupSendMailPerson.jsp?page=customer&idx=#{item.pk100}&mailx=#{item.kv967}&typex=customer&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickboxas"  ><h:outputText value="#{item.kv967}" /></h:outputLink>
                                                        </div>

                                                        <div class="itemheaderdivtable_center " style="width:8%;">
                                                            <h:panelGroup rendered="#{loginSession.right.COM_LST_FEB}">
                                                                <div class="rating_star" style="float: left;width: 100%;">
                                                                    <div class="rateit" lang="<h:outputText value='#{item.pk100}'/>" id="<h:outputText value='#{item.pk100}'/>" data-rateit-min="0" data-rateit-value="<h:outputText value='#{item.kv110}'/>"></div>
                                                                </div>
                                                            </h:panelGroup>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 4%;">
                                                            <h:outputText style="color:red;font-weight:bold;" value="#{item.vv031}"/>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 10%;">
                                                            <h:outputLink   rendered="#{loginSession.right.COM_PER_MOD}"  value="changeperson.jsp?id=#{item.pk100}&page=cuscompany.jsp&fn850=#{item.fn850}&qv101=#{item.kv102}&flag=K100&page=cuscompany.jsp&height=150px&width=300px" styleClass="fancybox add_new" id="fancyboxff">
                                                                <span>
                                                                    <img  src="../images/icon7.png" alt="edit" title="edit" class="imggroup"/>
                                                                </span>
                                                            </h:outputLink>
                                                            <h:outputLink value="popupSendMailPerson.jsp?page=employee&idx=-1&mailx=#{item.tnhiem}&typex=employee&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox23"  ><h:outputText value="#{item.tnhiemst}" style="float:left;margin-left:5px;padding:4px;"/></h:outputLink>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 10%;">

                                                            <h:outputText rendered="#{item.kv101!=null}" value="#{item.kv101st}" title="#{item.kv101}"/>
                                                            <h:outputText rendered="#{item.kv101==null}" value="&nbsp" escape="false"/>
                                                            <h:outputText rendered="#{item.kv101==''}" value="&nbsp" escape="false"/>
                                                        </div>
                                                        <div class="itemheaderdivtable_left " style="width: 12%;line-height: 12px;font-size: 8px;">
                                                            <h:outputText value="#{item.kl198}"/></br>
                                                            <h:outputText value="#{item.kl199}"/>
                                                        </div>
                                                    </div>
                                                    <div class="noteContent">

                                                    </div>
                                                </a4j:repeat>
                                            </div>
                                        </h:panelGroup>
                                    </div>
                                    <div class="fotter-page" >
                                        <jsp:include page="../../common/pagingK100.jsp"/>
                                    </div>
                                </div>

                                <!-- End List Content-->    
                            </div>
                            <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                             height="30" width="40" zindex="2000">
                                <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                            </rich:modalPanel>
                        </div>

                    </div>
                </div>

            </a4j:form>
        </body>
        <script type="text/javascript" src="../scripts/webcame/jquery.webcam.js"></script>
    </html>
</f:subview>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
    $j(document).ready(function(){
        //                    $j( ".sendSMS_personnv" ).click(function() {
        //                        $j( "#togglesms" ).show();
        //                        $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
        //                        $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
        //                        var info = $j(this).attr('lang');
        //                        fk100 = $j(this).parent().attr("lang");
        //                        $j.post("SgtSMS.jsp?"+info+"&fk100="+fk100,function(data){
        //                            if(data!=null){
        //                                $j( "#togglesms" ).html(data);
        //                            }
        //                        });
        //                    });
        $j( ".sendSMS_person" ).click(function() {
            $j( "#togglesms" ).show();
            $j( "#togglesms" ).animate({height:'auto',opacity:'0.9'},"slow");
            $j( "#togglesms" ).animate({width:'39%',opacity:'0.9'},"slow");
            info = $j(this).attr('lang');
            fk100 = $j(this).parent().attr("lang");
            //   alert(fk100+info);
            $j.post("SgtSMS.jsp?"+info+"&fk100="+fk100,function(data){
                if(data!=null){
                    $j( "#togglesms" ).html(data);
                }
            });
        });
        $j('.search_boxnew').hide();       
        $j('.sidebar_search').live('click',function(){
            $j('.search_boxnew').hide();
            if($j(this).next().hasClass('active')){

                $j('.search_boxnew').removeClass('active');
            }else{

                $j('.search_boxnew').removeClass('active');
                $j(this).next().addClass('active');
                $j(this).next().show();
            }
        });
        $j(".content_right").live("click",function(){
            $j('.search_boxnew').hide();
        });
        $j('.itemcontent').live('click',function(){
            showPleaseWait(); 
            pn100 = $j(this).attr('lang'); 
                   
            $j('.noteContent').slideUp();
            $j('.noteContent').html(''); 
            var debt = $j(this).parent().parent().next(); 
            if(debt.hasClass('active')){
                debt.removeClass('active');
            }else{                                               
                debt.removeClass('active');
                debt.addClass('active');                                               
                $j.post('itemCompanynew.jsp?action=getitemvaluePn100&pk100='+pn100,function(data){                      
                    if(data !=null){
                        hidePleaseWait();       
                        debt.html(data);
                      
                        debt.slideDown();
                    }
                });                    
            }
        });
        slide = gup( 'tab' );
        if(slide != null && slide !=undefined && slide.length > 0){
            $j('.'+slide).trigger('click') ;
        }
        $j(".department2").live("click",function(){
                    
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            showPleaseWait(); 
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850,function(data){
                if(data!=null){ 
                    window.location.href="cuscompany.jsp?action=reloadfordays&dayss="+0+"&flagFN850=10";
                    hidePleaseWait();        
                }
            }); 
        });
                
        $j(".department3").live("click",function(){
                     
            fh200 = $j(".donvi").attr("lang");
            fn850 = $j(this).attr("lang");
            fn450 = $j(".department1").attr("lang");
            showPleaseWait(); 
            $j.post("N450_N850.jsp?&action=group&fh200="+fh200+"&fn450="+fn450 +"&fn850="+fn850+"&emp=null",function(data){
                if(data!=null){ 
                    window.location.href="cuscompany.jsp?action=reloadfordays&dayss="+0+"&flagFN850=10";
                    hidePleaseWait();        
                }
            }); 
        });
        
    });
</script>
<style>
    .header-box{
        margin-left:25px;
        color:#263340;
        margin-top:10px;
        float: left;
        cursor:pointer;
        padding:4px 0px 0px 4px; 
        width:600px;
        border:1px solid #CCCCCC;
        font-size:12px;
        background: #D4D7D8;
        height: 21px;
        font-weight: bold;
    }
    .customer-box{
        float:left; width:604px; margin-left:25px;
        border:1px solid #CCCCCC;
        padding:18px 0px 10px 0px;
        background: #E5E8EA;
        border-top: none;

    }
    .customer-box label{
        width:90px;
        text-align: right;
        float:left;
    }
    .scapture{
        visibility: hidden;

    }
    .fields_more{
        float:left;

        margin-top:44px !important;
    }

    .detail_more{
        float:left;
        /* margin-left:254px !important;*/
    }

    .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}
    .buttonsearch2{
        border:0;
        background:url(../images/bg_submit.gif) repeat-x;
        width:68px;

        margin:0px 0 10px 20px;
        color:#ffffff;
        font-size:12px;
        font-weight:bold;
        cursor:pointer;
        border-radius:2px;
        padding:4px 0;
        text-transform:uppercase;
    }
    .mesage{
        color: red;
        float: left;
        margin-left: 252px;
        margin-top: 20px;
        text-transform: uppercase;

    }
    .updateN900{
        color:#fff;
        text-align: left;
        margin-left:8px;
        cursor: pointer;
        width:95% !important;
    }
    input{
        float:left;
        margin-left:9px;
    }
    select{
        float:left;
        height: 21px;
        width:82px;
        margin-left:9px;
    }
    .departmentlistN850 ul li{
        background: url("../images/bg_button2.gif");

    }

    .departmentlistN850 ul li span{
        width:125px !important;

    }

    .department:hover .departmentlist{display: block !important;z-index: 999;}
    .feild_sex{
        height: 127px !important;
        margin-left: 5px;
        margin-top: 14px;
        padding: 15px;
        width: 195px;
    }
    .chose1 a{
        width:125px !important;
    }
    /*            .popup-content .main_content .form_item_content .edit_form_left .fields_input {
                    float: left;
                    margin-top: 0px !important;
                    width: 100%;
                }
                .popup-content .main_content .form_item_content .edit_form_right .fields_input {
                    float: left;
                    margin-top: 0px !important;
                    width: 100%;
                }*/
    .fields_input {
        float: left;

        width: 100%;
    }
    .buttonsaveS{
        background: url("../images/bg_submit.gif") repeat-x scroll 0 0 transparent;
        border: 0 none;
        border-radius: 5px 5px 5px 5px;
        box-shadow: 0 2px 3px #666666;
        color: #FFFFFF;
        cursor: pointer;
        float: right;
        font-size: 14px;
        font-weight: bold;
        margin: 19px 10px 10px;
        padding: 8px 0;
        text-transform: uppercase;
        width: 98px;
        text-align: center;
    }
    .sidebar .search_box .fields_submit input[type="submit"]{
        width: 98px !important;
    }
    .moreMail img{
        width: 22px;
        height: 22px;
    }
    .buttonExcel {
        background: url("../images/excelnew.png") repeat-x scroll 0 0 transparent;
        border: 0 none;
        cursor: pointer;
        float: left;
        height: 25px;
        width: 30px;
    }
    .fields_edit img{
        height: 15px;
        width: 16px;
    }
    .deletepage img{
        height: 22px;
        width: 22px;
    }
    .sidebar_row2 img{
        height: 0px !important;
        width: 0px !important;
    }
    .sidebar_search {
        background: url("../images/searchnew.png") no-repeat scroll 100% 0 transparent;
        border: 0 none;
        cursor: pointer;
        float: left;
        height: 25px !important;
        line-height: 43px;
        margin-top: 0;
        padding-right: 31px;
        text-align: left;
    }

    .sidebar_search span {

        color: #FFFFFF;
        float: left;
        font-size: 14px;
        height: 36px;
        padding-left: 18px;
        text-shadow: 2px 2px 3px #333333;
        text-transform: uppercase;
        width: 200px;
    }
    .sidebar_row1 img{
        height: 30px;
        width: 46px;
    }
    .sidebar_row2 img{
        height: 30px;
        width: 46px;
    }
    .sidebar_row1{
        width: 4%;
    }

    .sidebar_row2 {
        margin-bottom: 0px;
        width: 2%;
    }

    .sidebar_row2 .sidebar{
        margin-bottom: 0px;
        width: 100% !important;
    }
    .content_right .content .list_content .item .fields_info{
        width: 26% !important;
    }
    .content_right .content .list_content .item .fields_contact_emp{
        width:30% !important;
    }
    .sendSMS_person{
        color: #0055A6;;
        cursor: pointer;
    }
    #togglesms {
        background: none repeat scroll 0 0 #226579;
        float: left;
        right: 0px;
        margin-top: 100px;
        position: absolute;
        z-index: 999;
        border-radius: 3px;
        border: 1px solid #53B4BF;
    }
    .classimageSMS{
        float:left;
    }

    .active{
        display: block;

    }

    .itemcontent{
        cursor: pointer;
    }
    .menutop2 img{
        height: 25px;
        width: 25px;
    }

    .cssgroup {
        background: none repeat scroll 0 0 #2B3844;
        color: white;
        display: none;
        float: left;
        height: 180px;
        margin-top: 2.6%;
        width: 11.2%;
        margin-left: -124px;

    }
    .imagesearchbox img{
        height: 22px !important;
        width: 18px !important;
    }
    .rich-tabpanel-content  {
        background: #E6E9EB;
        padding: 1px;
    }
    .rich-tabhdr-side-border{
        background-image: none;
    }
    .cbxEmp {
        float: right;
    }
    .cbxEmp select{
        height: 26px;
        width: 92%;
    }
    .fillterby .dropdownby .select_hidden{
        top:23px !important;
    }
    .showdatafor{
        cursor: pointer;
    }
    .showdatafor1{
        background-color: #fff;
        display: none;position: absolute;z-index: 9999;width: 169px;height: 132px;
        border: 1px solid #567676;
    }
    .active{
        display: block;

    }
    .select_group{
        margin-left: 5px;
    }
</style>